﻿using Abp.AutoMapper;
using Akso.Entities;
using Akso.Infrastructure.Data.Annotations;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Akso.ItemDetails.Dto
{
    /// <summary>
    /// 新增、编辑代码组页面显示数据时的Dto对象，可以被其它Dto使用
    /// </summary>
    [AutoMap(typeof(ItemDetail))]
    public class ItemDetailEditDto
    {
        public Guid? Id { get; set; }
        /// <summary>
        /// 物品分类
        /// </summary>
        [Required]
        [MaxLength(ItemDetail.MaxNameLength)]
        public virtual string ItemName { get; set; }
        /// <summary>
        /// 物品代码
        /// </summary>
        [MaxLength(ItemDetail.MaxCodeLength)]
        public virtual string ItemCode { get; set; }
        /// <summary>
        /// 规格
        /// </summary>
        [MaxLength(ItemDetail.MaxSpecificationLength)]
        public virtual string Specification { get; set; }
        /// <summary>
        /// 采购单价
        /// </summary>
        [DecimalPrecision(10, 2)]
        public virtual decimal PurchasePrice { get; set; }
        /// <summary>
        /// 销售单价
        /// </summary>
        [DecimalPrecision(10, 2)]
        public virtual decimal SalePrice { get; set; }
        /// <summary>
        /// 单位
        /// </summary>
        [MaxLength(ItemDetail.MaxUnitLength)]
        public virtual string Units { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        [MaxLength(ItemDetail.MaxRemarkLegth)]
        public virtual string Remark { get; set; }

        /// <summary>
        /// 物品分类ID 外键
        /// </summary>
        [Required]
        public Guid ItemCategoryId { get; set; }
    }
}
